package com.gof.example.abstract_adapter;

import com.gof.example.adapter.Md5;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/6 10:18.
 * haiming.fei@tongdun.cn
 */
//多对象适配器
public class EncryptionMoreFuncAdapter extends AbstractEncryptionMoreFuncAdapter {

    private static Md5 md5 = new Md5();
    private static Des des = new Des();

    public EncryptionMoreFuncAdapter() {
        System.out.println("object adapter pattern");
    }

    @Override
    public String enc4md5(String str) {
        return md5.enc(str);
    }

    @Override
    public String enc4des(String str) {
        return des.desenc(str);
    }
}
